#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int m, n;
	while (2 == scanf("%d%d", &m, &n)) {
		if (m == 0 && n == 0)
			break;
		int am[] = { m % 10, (m / 10) % 10, m / 100 };
		int an[] = { n % 10, (n / 10) % 10, n / 100 };
		int tot = 0, sc = 0, i;
		for (i = 0; i < 3; i++) {
			sc = (sc + am[i] + an[i]) / 10;
			tot += sc;
		}
		printf("%d\n", tot);
	}
	return EXIT_SUCCESS;
}
